package com.spark.userservice.service.impl;

import com.spark.userservice.service.ITestService;
import org.redisson.api.RReadWriteLock;
import org.redisson.api.RedissonClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author fuqiang
 * @Description 测试类
 * @Date 2020/10/19
 */
@Service
public class TestServiceImpl implements ITestService {

    @Autowired
    private RedissonClient redissonClient;

    private static String LOCK = "test";
    @Override
    public void testRedission() {
        RReadWriteLock readWriteLock = redissonClient.getReadWriteLock(LOCK);
        System.out.println(readWriteLock.writeLock());
    }
}
